package cn.s1995.sloth.bizs.entity;

import cn.s1995.sloth.bizs.annotation.SysDictType;
import cn.s1995.sloth.bizs.constant.DictNames;
import cn.s1995.sloth.bizs.converter.SysDictConverter;
import cn.s1995.sloth.bizs.entity.base.BaseEntity;
import cn.s1995.sloth.bizs.oo.vo.VideoProdRecommendVO;
import cn.s1995.sloth.common.core.convert.JoinUrlPrefixConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 视频
 *
 * @author Sasshi
 * @date 2023-12-12 10:51:22
 */
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "视频")
@TableName("biz_video")
@ExcelIgnoreUnannotated
public class Video extends BaseEntity {


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private Long id;

	/**
	* 用户id
	*/
    @Schema(description = "用户id")
    private Long uid;

	/**
	* 店铺id
	*/
    @Schema(description = "店铺id")
    private Long shopId;

	/**
	* 名称
	*/
    @Schema(description = "视频名称")
    private String name;

	/**
	* 宽度
	*/
    @Schema(description = "宽度")
    private Integer width;

	/**
	* 高度
	*/
    @Schema(description = "高度")
    private Integer height;

	/**
	* 视频地址
	*/
    @ExcelProperty(value = "视频地址", index = 0)
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
    @Schema(description = "视频地址")
    private String url;

	/**
	* 视频首帧地址
	*/
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
    @Schema(description = "视频首帧地址")
    private String frameUrl;

	/**
	* 描述
	*/
    @ExcelProperty(value = "描述", index = 1)
    @TableField(value = "`desc`")
    @Schema(description = "描述")
    private String desc;

	/**
	* 类型：1.普通用户 2.工厂
	*/
    @SysDictType(DictNames.biz_video_type)
    @ExcelProperty(value = "类型", index = 2, converter = SysDictConverter.class)
    @Schema(description = "类型：1.普通用户 2.工厂")
    private Integer type;

	/**
	* 点赞数量
	*/
//    @JsonSerialize(using = NumberFormatConvert.class)
    @ExcelProperty(value = "点赞数量", index = 3)
    @Schema(description = "点赞数量")
    private Integer praiseCount;

	/**
	* 评论数量
	*/
//    @JsonSerialize(using = NumberFormatConvert.class)
    @ExcelProperty(value = "评论数量", index = 4)
    @Schema(description = "评论数量")
    private Integer commentCount;

	/**
	* 收藏数量
	*/
//    @JsonSerialize(using = NumberFormatConvert.class)
    @ExcelProperty(value = "收藏数量", index = 5)
    @Schema(description = "收藏数量")
    private Integer favoriteCount;

	/**
	* 分享数量
	*/
//    @JsonSerialize(using = NumberFormatConvert.class)
    @ExcelProperty(value = "分享数量", index = 6)
    @Schema(description = "分享数量")
    private Integer shareCount;

	/**
	* 播放数量
	*/
//    @JsonSerialize(using = NumberFormatConvert.class)
    @ExcelProperty(value = "播放数量", index = 7)
    @Schema(description = "播放数量")
    private Integer playCount;

	/**
	* 是否上架
	*/
    @SysDictType(DictNames.yes_no_bool)
    @ExcelProperty(value = "是否上架", index = 8, converter = SysDictConverter.class)
    @Schema(description = "是否上架")
    private Boolean isSale;

	/**
	* 是否置顶
	*/
    @SysDictType(DictNames.yes_no_bool)
    @ExcelProperty(value = "是否置顶", index = 9, converter = SysDictConverter.class)
    @Schema(description = "是否置顶")
    private Boolean isTop;

	/**
	* 状态：0.待审核 1.通过 2.拒绝
	*/
    @SysDictType(DictNames.common_audit_state)
    @ExcelProperty(value = "类型", index = 10, converter = SysDictConverter.class)
    @Schema(description = "状态：0.待审核 1.通过 2.拒绝")
    private Integer state;

	/**
	* 基础收藏数量
	*/
    @Schema(description = "基础收藏数量")
    private Integer baseFavoriteCount;

	/**
	* 基础点赞数量
	*/
    @Schema(description = "基础点赞数量")
    private Integer basePraiseCount;

	/**
	* 置顶时间
	*/
    @Schema(description = "置顶时间")
    private LocalDateTime topTime;

	/**
	* 删除标识
	*/
	@TableLogic
	@TableField(fill = FieldFill.INSERT)
    @Schema(description = "删除标识", hidden = true)
    private Boolean delFlag;

	/**
	 * 视频关联的产品
	 */
	@TableField(exist = false)
	private List<VideoProdRecommendVO> videoProdRecommendList;

}
